using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class BalckDongHotKeyController : MonoBehaviour
{
    KeyCode hotKeyCode;
    SpriteRenderer sr;
    TextMeshProUGUI hotKeyCodeText;
    BlackDongSkillControl blackDongSkillControl;
    Transform enemyTransform;
    bool hotkeyisPush = false;
    public void SetupHotKey(KeyCode keyCode, Transform enemyTransform, BlackDongSkillControl blackDongSkillControl,bool hotkeyisPush)
    {
        hotKeyCodeText = GetComponentInChildren<TextMeshProUGUI>();
        sr = GetComponent<SpriteRenderer>();
        hotKeyCode = keyCode;
        hotKeyCodeText.text = hotKeyCode.ToString();
        this.enemyTransform = enemyTransform;
        this.blackDongSkillControl = blackDongSkillControl;
        this.hotkeyisPush = hotkeyisPush;

    }

    private void Update()
    {
        if (Input.GetKeyDown(hotKeyCode)&&!hotkeyisPush)
        {
            blackDongSkillControl.AddEnemyToList(enemyTransform);
            sr.color = Color.clear;
            hotKeyCodeText.color = Color.clear;
            hotkeyisPush = true;
        }
    }
}
